import { createRouter, createWebHashHistory } from 'vue-router'
import SupermapLayout from "@/layout/index.vue";
import MapLayout from "@/layout/Map/index.vue";
import ManagerLayout from "@/layout/Manager/index.vue";

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: SupermapLayout,
      redirect: '',
      children: [{
        path: 'main',
        component: MapLayout,
        redirect: '',
        children: [
          {
            // 主页面
            path: 'overview',
            name: 'Overview',
            meta: {
              title: 'Overview'
            },
            component: () => import('../views/pages/main/index.vue')
          },
          // 供热监测
          {
            path: 'search',
            name: 'Search',
            meta: {
              title: 'search'
            },
            component: () => import('../views/pages/search/index.vue')
          },
          // 故障预警
          {
            path: 'decision',
            name: 'Decision',
            meta: {
              title: 'decision'
            },
            component: () => import('../views/pages/decision/decision.vue')
          }
        ]
      }, {
        path: 'operations',
        name: 'Operations',
        component: ManagerLayout,
        children: [{
          path: 'manager',
          name: 'Manager',
          meta: {
            title: 'manager',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/manager/index.vue')
        }, {
          path: 'report',
          name: 'Report',
          meta: {
            title: 'report',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/report/index.vue')
        }, {
          path: 'recall',
          name: 'Recall',
          meta: {
            title: 'recall',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/recall/index.vue')
        }, {
          path: 'monitor',
          name: 'Monitor',
          meta: {
            title: 'monitor',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/monitor/index.vue')
        },{
          path: 'monitor2',
          name: 'Monitor2',
          meta: {
            title: 'monitor2',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/monitor/monitor2.vue')
        }, {
          path: 'threshold',
          name: 'Threshold',
          meta: {
            title: 'threshold',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/threshold/index.vue')
        }, {
          path: 'threshold2',
          name: 'Threshold2',
          meta: {
            title: 'threshold2',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/threshold2/index.vue')
        }, {
          path: 'system',
          name: 'System',
          meta: {
            title: 'system',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/blank/index.vue')
        }, {
          path: 'warning',
          name: 'Warning',
          meta: {
            title: 'warning',
            pName: 'Operations',
          },
          component: () => import('../views/pages/operations/warning/index.vue')
        }]
      }]
    }
  ]
})

export default router
